package com.neusoft.util;

import java.io.Serializable;

/**
 * HTTP摘要认证鉴权参数实体类
 * @author 郑兴龙 zheng-xl@neusoft.com
 *
 */
public class AuthenticateDigest implements Serializable
{
    /**
     * 默认序列号
     */
    private static final long serialVersionUID = 3605690252872551621L;

    /**
     * cu透传过来的用户名和域(loginname@logindomain)
     */
    private String userName;
    
    /**
     * 与平台约定好的域名
     */
    private String realm;
    
    /**
     * 与平台约定好的摘要认证密码
     */
    private String password;
    
    /**
     * 401响应中唯一生成的字符串数据
     */
    private String nonce;
    
    /**
     * 保护质量
     * <br>auth：鉴权，不对消息体做完整性验证。
     * <br>auth-int：鉴权并需要对消息体做摘要，保证消息完整性。
     */
    private String qop;
    
    /**
     * 请求的URI
     */
    private String uri;
    
    /**
     * 服务端质询响应信息
     */
    private String opaque;

    /**
     * 客户端计算的客户端nonce
     */
    private String cnonce;
    
    /**
     * 客户端计算的信息
     */
    private String nc;
    
    /**
     * 最终的摘要信息（经过ha3加密）
     */
    private String response;
    
    /**
     * 无参构造函数
     */
    public AuthenticateDigest()
    {
    }
    
    /**
     * 构造函数
     * @param realm realm
     * @param nonce nonce
     */
    public AuthenticateDigest(String realm, String nonce)
    {
        this.realm = realm;
        this.nonce = nonce;
    }
    
    /**
     * 构造函数
     * @param userName userName
     * @param realm realm
     * @param nonce nonce
     */
    public AuthenticateDigest(String userName, String realm, String nonce)
    {
        this.userName = userName;
        this.realm = realm;
        this.nonce = nonce;
    }
    
    public String getRealm()
    {
        return realm;
    }
    
    public void setRealm(String realm)
    {
        this.realm = realm;
    }
    
    public String getPassword()
    {
        return password;
    }

    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getNonce()
    {
        return nonce;
    }
    
    public void setNonce(String nonce)
    {
        this.nonce = nonce;
    }
    
    public String getUserName()
    {
        return userName;
    }
    
    public void setUserName(String userName)
    {
        this.userName = userName;
    }
    
    public String getQop()
    {
        return qop;
    }
    
    public void setQop(String qop)
    {
        this.qop = qop;
    }
    
    public String getUri()
    {
        return uri;
    }
    
    public void setUri(String uri)
    {
        this.uri = uri;
    }
    
    public String getOpaque()
    {
        return opaque;
    }
    
    public void setOpaque(String opaque)
    {
        this.opaque = opaque;
    }
    
    public String getCnonce()
    {
        return cnonce;
    }
    
    public void setCnonce(String cnonce)
    {
        this.cnonce = cnonce;
    }
    
    public String getNc()
    {
        return nc;
    }
    
    public void setNc(String nc)
    {
        this.nc = nc;
    }
    
    public String getResponse()
    {
        return response;
    }
    
    public void setResponse(String response)
    {
        this.response = response;
    }
    
}
